home *** CD-ROM | disk | FTP | other *** search
Wrap
var CoolirisFramePanel={sendLink:"",isSendToOpen:false,sendToBoxLink:"http://www.coolpreviews.com/client/scripts/sendto.php?version=2.7",helperLink:"chrome://cooliris/content/helperFrame.xul",fromPreview:true,subject:"",notes:"",link:"",isHelperFrameOpen:false,helperType:"lock",showHelperFrame:function(){ this.helperType="lock"; var _1=cpvw_prefHandler.getPref(cpvw_Prefs.prefShowHelperFrame); if(!_1){ return; } this.isHelperFrameOpen=true; this.helperBox=document.createElement("vbox"); this.helperBox.setAttribute("id","cooliris_helperBox"); this.helperFrame=document.createElement("browser"); this.helperFrame.setAttribute("src",CoolirisFramePanel.helperLink); this.helperFrame.setAttribute("disablehistory",true); this.helperFrame.setAttribute("id","cooliris_helperFrame"); this.helperFrame.setAttribute("style","width:100%;height:100%;background-color:black;"); this.helperBox.appendChild(this.helperFrame); this.helperBox.addEventListener("mouseover",function(_2){ clearTimeout(cpvw_docHandler.hideTimer); },true); this.helperFrame.addEventListener("coolpreviewsHelperDontShowEvent",function(_3){ CoolirisFramePanel.closeHelperFrame(false); },false,true); this.helperFrame.addEventListener("coolpreviewsHelperCloseEvent",function(_4){ CoolirisFramePanel.closeHelperFrame(true); },false,true); this.helperFrame.addEventListener("DOMContentLoaded",function(_5){ CoolirisFramePanel.helperFrame.contentDocument.getElementById("cooliris-helper-content").setAttribute("type",CoolirisFramePanel.helperType); },false,true); document.getElementById("main-window").appendChild(this.helperBox); var _6=cpvw_previewHandler.dimPreview; var _7=_6.left+_6.width-386; var _8=_6.top+31; cpvw_jsUtils.setPosition(this.helperBox,_7,_8,385,219); this.helperBox.setAttribute("class","cooliris-helperframe"); },closeHelperFrame:function(_9){ this.isHelperFrameOpen=false; if(!_9){ if(this.helperType=="lock"){ cpvw_prefHandler.setPref(cpvw_Prefs.prefShowHelperFrame,false); } } if(cpvw_get("cooliris_helperBox")!=null){ document.getElementById("main-window").removeChild(cpvw_get("cooliris_helperBox")); } },sendDirectly:function(_a){ CoolirisFramePanel.fromPreview=false; var _b=new cpvw_nsNodeType(); _b.getNodeType(); CoolirisFramePanel.link=""; CoolirisFramePanel.notes=""; CoolirisFramePanel.subject=""; if(_b.onImage){ CoolirisFramePanel.link=_b.imageURL; }else{ if(_b.onLink){ CoolirisFramePanel.link=_b.linkURL; }else{ if(_b.isTextSelected){ var _c=document.commandDispatcher.focusedWindow; var _d=_c.getSelection(); CoolirisFramePanel.notes=_d; }else{ CoolirisFramePanel.link=document.popupNode.ownerDocument.location.href; CoolirisFramePanel.subject=document.popupNode.ownerDocument.title; } } } CoolirisFramePanel.showSendTo(_a,false); },showSendTo:function(_e,_f){ this.fromPreview=_f; if(this.isSendToOpen){ this.closeSendToOptions(); return; } cpvw_objStats.sendButtonClickEvents("SendTo"); this.isSendToOpen=true; this.sendToBox=document.createElement("vbox"); this.sendToBox.setAttribute("id","cooliris_sendToBox"); this.sendToFrame=document.createElement("browser"); this.sendToFrame.setAttribute("src",CoolirisFramePanel.sendToBoxLink); this.sendToFrame.setAttribute("disablehistory",true); this.sendToFrame.setAttribute("id","cooliris_sendToFrame"); this.sendToFrame.setAttribute("style","width:100%;height:100%;background-color:black;"); this.sendToFrame.addEventListener("load",function(_10){ CoolirisFramePanel.onIframeLoad(_10); },true); this.sendToBox.appendChild(this.sendToFrame); this.sendToFrame.addEventListener("coolpreviewsClosePopupEvent",function(evt){ CoolirisFramePanel.closeSendToOptions(); },false,true); cpvw_previewHandler.stickPreview(true); document.getElementById("main-window").appendChild(this.sendToBox); this.sendToBox.hidden=false; cpvw_jsUtils.setPosition(this.sendToBox,1,1,1,1); this.sendToBox.setAttribute("class","cooliris-innerframe"); },onIframeLoad:function(evt){ var _13=document.getElementById("cooliris_sendToFrame").contentDocument; var _14,_15; if(_13.URL.indexOf("login.php")!=-1){ _13.getElementById("cooliris_Register").removeEventListener("click",CoolirisFramePanel.saveUserInfo,false); _13.getElementById("cooliris_Login").removeEventListener("click",CoolirisFramePanel.saveUserInfo,false); _13.getElementById("cooliris_Register").addEventListener("click",CoolirisFramePanel.saveUserInfo,false); _13.getElementById("cooliris_Login").addEventListener("click",CoolirisFramePanel.saveUserInfo,false); var _16=cpvw_Prefs.getUserInfo(); _13.getElementById("cooliris_UserEmail").value=_16[0]; _14=parseInt(_13.getElementById("width").value); _15=parseInt(_13.getElementById("height").value); }else{ if(_13.URL.indexOf("sendto.php")!=-1){ var _17=cpvw_Prefs.getSendToEmail(); if(_13.getElementById("cooliris_sendToLink")==null){ return; } if(CoolirisFramePanel.fromPreview){ var _18=cpvw_previewHandler.getPreviewFrame(); var _19=_18.contentDocument.URL; if(_18.contentDocument.URL=="chrome://cooliris/content/coolirisPreviewImages.htm"){ var doc=_18.contentDocument; if(doc.getElementById("imgPreview").style.visibility=="visible"){ _19=doc.getElementById("imgPreview").getAttribute("src"); }else{ _19=doc.getElementById("tmpImgPreview").getAttribute("src"); } } CoolirisFramePanel.link=_19; CoolirisFramePanel.subject=_18.contentDocument.title; CoolirisFramePanel.notes=""; } _13.getElementById("cooliris_sendToLink").value=CoolirisFramePanel.link; _13.getElementById("cooliris_sendToEmail").value=_17; _13.getElementById("cooliris_sendToSubject").value=CoolirisFramePanel.subject; _13.getElementById("cooliris_sendToNotes").value=CoolirisFramePanel.notes; _13.getElementById("cooliris_sendToSend").removeEventListener("click",CoolirisFramePanel.saveToEmailAddress,false); _13.getElementById("cooliris_sendToSend").addEventListener("click",CoolirisFramePanel.saveToEmailAddress,false); _14=parseInt(_13.getElementById("width").value); _15=parseInt(_13.getElementById("height").value); } } var _1b=document.getElementById("cooliris_sendToBox"); if(_1b.style.height!=_15){ var _1c=(screen.width/2)-(_14/2); var top=(screen.height/2)-(_15/2); if(CoolirisFramePanel.fromPreview){ var _1e=cpvw_previewHandler.dimPreview; _1c=_1e.left+90; top=_1e.top+31; } cpvw_jsUtils.setPosition(cpvw_get("closeCoolirisFramePanel"),_1c+_14-18,top+1,18,18,true); cpvw_jsUtils.setPosition(_1b,_1c,top,_14,1); var _1f=new cooliris_wc_clsWebControl(_1b,new cooliris_wc_Point(_1c,top),new cooliris_wc_Point(_1c,top),"expand"); _1f.setDim(new cooliris_wc_Dim(_14,20),new cooliris_wc_Dim(_14,_15)); _1f.maxTimes=10; setTimeout(function(){ _1f.expand(); },0); } },saveToEmailAddress:function(){ var _20=document.getElementById("cooliris_sendToFrame").contentDocument; var _21=_20.getElementById("cooliris_sendToEmail").value; cpvw_Prefs.setSendToEmail(_21); var _22=1; if(_21.indexOf(",")!=-1){ _22=_21.split(",").length; }else{ if(_21.indexOf(";")!=-1){ _22=_21.split(";").length; } } cpvw_objStats.sendMessageEvents(_22); setTimeout(function(){ CoolirisFramePanel.checkEmailSent(); },500); },checkEmailSent:function(){ var _23=document.getElementById("cooliris_sendToFrame").contentDocument; if(_23.getElementById("cooliris_sendToStatus").value=="-1"){ setTimeout(function(){ CoolirisFramePanel.checkEmailSent(); },500); } if(_23.getElementById("cooliris_sendToStatus").value=="1"){ setTimeout(function(){ CoolirisFramePanel.closeSendToOptions(); },3000); } },closeSendToOptions:function(){ if(this.sendToBox!=null){ document.getElementById("main-window").removeChild(this.sendToBox); } delete this.sendToBox; this.sendToBox=null; this.isSendToOpen=false; cpvw_previewHandler.stickPreview(false); },saveUserInfo:function(){ var _24=document.getElementById("cooliris_sendToFrame").contentDocument; var _25=_24.getElementById("cooliris_UserEmail").value; var _26=_24.getElementById("cooliris_UserPwd").value; if(cpvw_jsUtils.trimWhitespace(_25)==""||cpvw_jsUtils.trimWhitespace(_26)==""){ alert("Username/Password empty"); }else{ cpvw_Prefs.setUserEmail(_25,_26); } }};